﻿{include file="common/head"/}
<body>
<div class="page" id="feedback_view">
    {include file="common/loginHead"/}

    <div class="content transfer-content">
        <div class="transfer-box">
            <form class="layui-form up-down" onsubmit="return false">
                <input type="hidden" value=""  name="buttons" id="buttons"/>
                <input type="hidden" value="user/xigu/tousu_do" name="root"/>
                <div class="list-block">
                    <ul>
                        <li>
                            <div class="item-content">
                                <div class="item-title">问题或意见</div>
                                <div class="item-input">
                                    <textarea name="content" lay-verify="require"  autocomplete="off" placeholder="请写下您的宝贵意见或建议"></textarea>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-title">图片说明<span
                                        style="color:#6e6e6e;font-size: .5rem;margin-left: .5rem;line-height: .75rem">请提供问题的截图</span>
                                </div>
                                <div class="item-input">
                                    <div class="images">
                                        <input class="layui-upload-file" type="file" name="proimg">
                                        <img  src="/static/xigu/picture/upload.png" class="upload"/>
                                    </div>
                                    <input name="images" value="" class="upload_file" type="hidden"/>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-title">联系方式</div>
                                <div class="item-input">
                                    <input type="text" name="contact" lay-verify="require" autocomplete="off" lay-verify="required" placeholder="请留下您的联系方式，便于与我们联系">
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
                <button class="click-btn" lay-submit lay-filter="BackForm">确认提交</button>
            </form>
        </div>
    </div>
    <script type='text/javascript' src='/static/xigu/js/jquery-3.3.1.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/xigu/js/light7.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/xigu/js/light7-swiper.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/xigu/js/light7-swipeout.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/xigu/js/cn.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/xigu/js/layui.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/xigu/js/basis.js' charset='utf-8'></script>
    <script>
        $(function(){
            $(".upload").click(function(){
                $(this).siblings(".layui-upload-file").click();
            })
        })
    </script>
    <script type="text/javascript">
        function open(){
            console.log(111);
            return false;

        }
        $(".layui-upload-file").change(function() {
            var formData = new FormData();
            var files = this.files[0],
                    thiss = $(this);
            formData.append('file',files);
            console.log(formData);
            $.ajax({
                type:'post',
                url:"{:url('deal/index/uploadImage')}",
                data:formData,
                async:false,
                processData : false,
                contentType : false,
                dataType:'JSON',
                success:function(data){
                    console.log(data)
                    if(data.status == 0){
                        $('.upload').attr('src',data.url);
                        $('#buttons').val(data.url);
                        /*thiss.siblings('.moneyInfos').attr('src',data.url).show();
                         thiss.siblings('.moneyInfos').parents('.example2').attr('href', data.url);
                         $('#buyImage').val(data.url);
                         thiss.parents('.parents').data('url',data.url)*/
                    }else{
                    }
                },
                error:function(e){
                },
                beforeSend:function(e){
                }
            });
        });
        $('#trade_details').off('click', '.show_img').on('click', '.show_img', function () {
            var pics = [];
            $('#trade_details .show_img').each(function (i, e) {
                pics.push($(e).attr('src'));
            })
            var myPhotoBrowserStandalone = $.photoBrowser({
                photos: pics
            });
            myPhotoBrowserStandalone.open();
        })

    </script>

</div>


</body>
</html>
